package com.gzhryc.shared_device.oem.code.profit.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.*;
import com.gzhryc.jdbc.enums.DateBranchTableType;
import com.gzhryc.shared_device.oem.code.user.ERoleType;

import java.io.Serializable;
import java.util.Date;

/**
 * 业务订单用户收益
 * @version 2023-02-01
 */
@DateBranchTable(type= DateBranchTableType.year)
@Table(name="business_order_user_profit")
public class BusinessOrderUserProfit implements Serializable {

    private static final long serialVersionUID = 1L;

	@PrimaryKey
    @Column(name = "trade_no", notNull = true, note = "订单号")
    protected String tradeNo;

    @PrimaryKey
    @Column(name = "user_id", notNull = true, note = "用户ID")
    protected Long userId;
    
    @Column(name = "order_date", notNull = true,note="订单时间")
    protected Date orderDate;

    @Column(name = "account_group_id", notNull = true, note = "账号组ID")
    protected Long accountGroupId;

    @Column(name = "agent_id", note = "关联代理ID")
    protected Long agentId;

    @Column(notNull = true, note = "用户姓名")
    protected String name;

    @Column(note = "用户手机号")
    protected String phone;

    @Column(name = "role_type", notNull = true, note = "用户角色")
    protected Integer roleType;

    @Column(name = "device_fun_code", notNull = true, note = "设备功能Code")
    protected String deviceFunCode;

    @Column(name = "business_type", notNull = true, note = "业务类型")
    protected String businessType;

    @Column(name = "income_ratio", notNull = true, defVal = "0", note = "分成比例")
    protected Double incomeRatio;

    @Column(notNull = true, defVal = "0", note = "分成金额，单位：厘")
    protected Long money;

    @Column(name="place_id",note = "网点ID")
    protected Long placeId;

    @Column(name="place_name",note = "网点名称")
    protected String placeName;

    @Column(note = "省")
    protected String province;

    @Column(note = "市")
    protected String city;

    @Column(name = "city_area", note = "城区")
    protected String cityArea;

    @Column(name = "area_code", length = 128, note = "地区ID，以逗号分隔")
    protected String areaCode;

    @Column(note = "分成描述")
    protected String note;

    @Column(notNull = true, defVal = "1", note = "分成状态，1:已分成，2:已撤销")
    protected Integer state;

    @Column(name = "update_date", autoUpdateTime = true, note = "修改时间")
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    
    public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	public Long getAccountGroupId() {
        return accountGroupId;
    }

    public void setAccountGroupId(Long accountGroupId) {
        this.accountGroupId = accountGroupId;
    }

    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getRoleType() {
        return roleType;
    }

    public void setRoleType(Integer roleType) {
        this.roleType = roleType;
    }

    public String getDeviceFunCode() {
        return deviceFunCode;
    }

    public void setDeviceFunCode(String deviceFunCode) {
        this.deviceFunCode = deviceFunCode;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public Double getIncomeRatio() {
        return incomeRatio;
    }

    public void setIncomeRatio(Double incomeRatio) {
        this.incomeRatio = incomeRatio;
    }

    public Long getMoney() {
        return money;
    }

    public void setMoney(Long money) {
        this.money = money;
    }

    public Long getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Long placeId) {
        this.placeId = placeId;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCityArea() {
        return cityArea;
    }

    public void setCityArea(String cityArea) {
        this.cityArea = cityArea;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getRoleTypeName() {
        return ERoleType.note(this.roleType);
    }

    public String getMoneyStr() {
        return NumberTools.getMoneyLiStr(this.money);
    }
}
